<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>for循环</title>
  <style>
    span {
      display: inline-block;
      width: 100px;
      padding: 5px 10px;
      border: 1px solid pink;
      margin: 2px;
      border-radius: 5px;
      box-shadow: 2px 2px 2px rgb(255, 192, 203, .1);
      text-align: center;
    }
  </style>
</head>

<body>
  <script>
    // let arr = ['1', '2', '3', '4']
    // for (let i = 0; i < arr.length; i++) {
    //   console.log(arr[i]);

    // }
    //嵌套循环--打印九九乘法表
    for (let i = 1; i < 10; i++) {
      for (let j = 1; j < i; j++) {
        document.write(`<span>${j} x ${i} = ${i * j}</span>`)
      }
      //换行
      document.write("<br>")
    }
  </script>
</body>

</html>